package com.reins.bookstore.entity;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;

import javax.persistence.*;

@Data
@Entity
@Table(name = "basketline")
@JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer","fieldHandler"})
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,property = "basketlineId")
public class Basketline {

    @Id
    @Column(name = "basketline_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int basketlineId;
    private int userId;
    private int bookId;
    private int bookNum;
    public Basketline(int basketlineId, int userId, int bookId, int bookNum){
        this.basketlineId = basketlineId;
        this.userId = userId;
        this.bookId = bookId;
        this.bookNum = bookNum;
    }
    public Basketline(Integer o, Integer userId, Integer bookId, Integer bookNum) {
        this.bookId = bookId;
        this.userId = userId;
        this.bookNum = bookNum;
    }

    public Basketline() {

    }
}
